<?php
require_once dirname(__FILE__) . '/../common/Database.php';
require_once dirname(__FILE__) . '/../common/DBConfig.php';
require_once dirname(__FILE__) . '/../users/Users.php';

$db = new Database();		
$db->Connect(new DBConfig());


//$database = "CREATE DATABASE IF NOT EXISTS `user`"; 
$tableAndColumns = "CREATE TABLE `users` . `user`
(
    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `username` VARCHAR(255),
    `fullname` VARCHAR(255),
    `password` VARCHAR(255),
    `email` VARCHAR(255)
)";

$user = User::create('user', 'Test User', md5('password'), 'testuser@example.com');

//$db->ExecuteNonQuery($database);
$db->ExecuteNonQuery($tableAndColumns);
$db->ExecuteNonQuery("INSERT INTO `users`.`user` (`id`, `username`,`fullname`, `password`, `email`) VALUES (NULL, '$user->username', '$user->fullname', '$user->password', '$user->email');");